import groovy.xml.DOMBuilder

String records = '''
 <library>	
      <Student>
         <StudentName division = 'A'>Joe</StudentName>
         <StudentID>1</StudentID>
      </Student>
      <Student>
         <StudentName division = 'B'>John</StudentName>
         <StudentID>2</StudentID>
      </Student>
      <Student>
         <StudentName division = 'C'>Mark</StudentName>
         <StudentID>3</StudentID>
      </Student>
   </library>'''

def rd = new StringReader(records)
def doc = DOMBuilder.parse(rd)
println doc.getClass()
println doc.fNodeName
println doc.fNodeValue